package cn.wolfcode.trip.base.service.impl;

import cn.wolfcode.trip.base.domain.LtCatalogDetail;
import cn.wolfcode.trip.base.mapper.LtCatalogDetailMapper;
import cn.wolfcode.trip.base.service.ILtCatalogDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LtCatalogDetailServiceImpl implements ILtCatalogDetailService {
    @Autowired
    private LtCatalogDetailMapper ltCatalogDetailMapper;


    @Override
    public void save(LtCatalogDetail ltCatalogDetail) {
        ltCatalogDetailMapper.insert(ltCatalogDetail);
    }

    @Override
    public void delete(Long id) {
        ltCatalogDetailMapper.deleteByPrimaryKey(id);
    }

    @Override
    public List<LtCatalogDetail> selectAll() {
        return ltCatalogDetailMapper.selectAll();
    }

    @Override
    public void update(LtCatalogDetail ltCatalogDetail) {
        ltCatalogDetailMapper.updateByPrimaryKey(ltCatalogDetail);
    }

    @Override
    public LtCatalogDetail get(Long id) {
        return ltCatalogDetailMapper.selectByPrimaryKey(id);
    }

    @Override
    public int getCatalogDetailBycbId(Long cbTwoId) {
        return ltCatalogDetailMapper.getCatalogDetailBycbId(cbTwoId);
    }

}
